package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.News;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.FollowQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int insert(User record);

    User selectByPrimaryKey(Long id);

    List<User> selectAll();

    int updateByPrimaryKey(User record);

    User selectUserByEmailAndPassword(@Param("email") String email, @Param("password") String password);

    List<User> selectForList(QueryObject qo);

    User selectIsVip(@Param("isVIP")Integer isVIP,@Param("id")Long id);

    void insertFollowRelation(@Param("followId") Long followId, @Param("fansId") Long fansId);

    void deleteFollowRelation(@Param("followId") Long followId, @Param("fansId") Long fansId);

    User selectUserByFollowIdAndFansId(@Param("followId") Long followId, @Param("fansId") Long fansId);

    List<User> selectFollowsForList(FollowQueryObject qo);

    List<User> selectFansForList(FollowQueryObject qo);

    User selectByStrategyGrandSonCommentId(Long grandSonId);
}